<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8">
        <title>系统消息</title>
        <meta content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=0" name="viewport"/>
        <meta content="yes" name="apple-mobile-web-app-capable"/>
        <meta content="black" name="apple-mobile-web-app-status-bar-style"/>
        <meta content="telephone=no" name="format-detection"/>
        <link rel="stylesheet" href="/js/friend/css/style.css">
        <link rel="stylesheet" href="/js/bootstrap/css/bootstrap.min.css">
        <link rel="stylesheet" href="/js/plugins/dialog/dialog.css">
        <script src="/js/jquery/jquery.min.js"></script>
        <link rel="stylesheet" href="/css/font/css/font-awesome.min.css" />
        <link rel="stylesheet" href="/css/reset.css" />
        <link rel="stylesheet" href="/css/myProfiles.css" />
        <script src="/js/plugins/jrender/jrender.js"></script>
        <script src="/js/common.js"></script>
        <script src="/js/plugins/dialog/dialog.min.js"></script>
        <link rel="stylesheet" href="/js/chat/fonts/feather/style.css">
    </head>
    <body>
    <div class="search-head">
        <div class="row nav-search">
            <div class="col">
                <a href="javascript:history.go(-1);">
                    <span><i class="fa fa-chevron-left" ></i></span>
                </a>
            </div>
            <div class="col">
                <span>消息内容</span>
            </div>
            <div class="col"></div>
        </div>
    </div> <hr/>


    <section class="aui-scrollView">
        <div class="divHeight"></div>
        <div class="aui-expert-list">
            <div render-loop="list">
                <a href="javascript:;" class="aui-flex">
                    <div class="aui-expert-user">
                        <img render-src="list.headImgUrl" alt="">
                    </div>
                    <div class="aui-flex-box">
                        <h1 render-html="list.nickName"></h1>
                        <h3 render-html="list.place"></h3>
                        <span>
                                <em></em>
                            </span>
                        <p></p>
                    </div>
                    <div class="aui-expert-chat">
                        <button class="accept" render-value="list.id" >
                            <i class="icon icon-news"></i>
                            接受
                        </button>
                    </div>
                </a>
            </div>
        </div>
    </section>

    </body>
<script>
    $(function () {
        $.get("/users/applyFriend",function (data) {

            $(".aui-expert-list").renderValues(data, {
                handle: function (ele, val) {
                    ele.href = "/strategyCatalogs.html?id=" + val;
                }
            });
        })
        // console.log($(".accept"));
        $("section").on("click",".accept",function(){
          var id=$(this).val();
            $(".accept").click(function () {
                $.ajax({
                    type: "put",
                    url: "/users/addFriend",
                    data: "id="+id,
                    success: function(data){
                        $(document).dialog({
                            type : "notice",
                            infoText: data.obj+"五秒后刷新面",
                            autoClose: 1500,
                            position: "bottom"
                        });
                        setTimeout(function () {
                            location.reload();
                        },5000)
                    }
                });
            })
        });


    })
</script>
</html>
